package com.platform.comm.entity;

import com.platform.vo.ExportRecordsDto;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author Administrator
 */
@Entity
@Table(name = "comm_batch_info")
public class CommBatchInfoEntity {
    private String id;
    private String functionId;
    private String jobId;
    private String jobType;
    private String jobStatus;
    private String jobMessage;
    private String delflag;
    private String jobResult;
    private String createBy;
    private String createName;
    private String createDate;
    private String createDept;
    private String createDeptName;
    private String jobName;

    private String commDataId;

    private BigDecimal totalCount= BigDecimal.ZERO;
    private BigDecimal validationCount = BigDecimal.ZERO;
    private BigDecimal cachedCount = BigDecimal.ZERO;
    private BigDecimal skippedCount = BigDecimal.ZERO;
    private BigDecimal repeatCount = BigDecimal.ZERO;
    private String repeatExcelUrl;

    private String finishDate;



    @Id
    @Column(name = "id", nullable = false, length = 32)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }




    @Basic
    @Column(name = "function_id", nullable = true, length = 32)
    public String getFunctionId() {
        return functionId;
    }

    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }

    @Basic
    @Column(name = "job_id", nullable = true, length = 32)
    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    @Basic
    @Column(name = "job_type", nullable = true, length = 20)
    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    @Basic
    @Column(name = "job_status", nullable = true, length = 20)
    public String getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }

    @Basic
    @Column(name = "job_message", nullable = true, length = 2048)
    public String getJobMessage() {
        return jobMessage;
    }

    public void setJobMessage(String jobMessage) {
        this.jobMessage = jobMessage;
    }

    @Basic
    @Column(name = "delflag", nullable = true, length = 2)
    public String getDelflag() {
        return delflag;
    }

    public void setDelflag(String delflag) {
        this.delflag = delflag;
    }

    @Basic
    @Column(name = "job_result", nullable = true, length = 500)
    public String getJobResult() {
        return jobResult;
    }

    public void setJobResult(String jobResult) {
        this.jobResult = jobResult;
    }

    @Basic
    @Column(name = "create_by", nullable = true, length = 36)
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    @Basic
    @Column(name = "create_name", nullable = true, length = 350)
    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    @Basic
    @Column(name = "create_date", nullable = true, length = 19)
    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "create_dept", nullable = true, length = 36)
    public String getCreateDept() {
        return createDept;
    }

    public void setCreateDept(String createDept) {
        this.createDept = createDept;
    }

    @Basic
    @Column(name = "create_dept_name", nullable = true, length = 320)
    public String getCreateDeptName() {
        return createDeptName;
    }

    public void setCreateDeptName(String createDeptName) {
        this.createDeptName = createDeptName;
    }

    @Basic
    @Column(name = "job_name", nullable = true, length = 300)
    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    @Basic
    @Column(name = "total_count", nullable = true)
    public BigDecimal getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(BigDecimal totalCount) {
        this.totalCount = totalCount;
    }

    @Basic
    @Column(name = "validation_count", nullable = true)
    public BigDecimal getValidationCount() {
        return validationCount;
    }

    public void setValidationCount(BigDecimal validationCount) {
        this.validationCount = validationCount;
    }

    @Basic
    @Column(name = "cached_count", nullable = true)
    public BigDecimal getCachedCount() {
        return cachedCount;
    }


    public void setCachedCount(BigDecimal cachedCount) {
        this.cachedCount = cachedCount;
    }

    @Basic
    @Column(name = "skipped_count", nullable = true)
    public BigDecimal getSkippedCount() {
        return skippedCount;
    }

    public void setSkippedCount(BigDecimal skippedCount) {
        this.skippedCount = skippedCount;
    }

    @Basic
    @Column(name = "commdata_id", nullable = true)
    public String getCommDataId() {
        return commDataId;
    }

    public void setCommDataId(String commDataId) {
        this.commDataId = commDataId;
    }

    @Basic
    @Column(name = "repeat_count", nullable = true)
    public BigDecimal getRepeatCount() {
        return repeatCount;
    }

    public void setRepeatCount(BigDecimal repeatCount) {
        this.repeatCount = repeatCount;
    }

    @Basic
    @Column(name = "repeat_excel_url", nullable = true)
    public String getRepeatExcelUrl() {
        return repeatExcelUrl;
    }

    public void setRepeatExcelUrl(String repeatExcelUr) {
        this.repeatExcelUrl = repeatExcelUr;
    }

    @Basic
    @Column(name = "finish_date", nullable = true)
    public String getFinishDate() {
        return finishDate;
    }

    public void setFinishDate(String finishDate) {
        this.finishDate = finishDate;
    }

    public ExportRecordsDto toDto() {
        ExportRecordsDto exDto = new ExportRecordsDto();
        exDto.setId(getId());
        exDto.setJobName(getJobName());
        exDto.setJobStatus(getJobStatus());
        exDto.setTotalCount(String.valueOf(getTotalCount()));
        exDto.setCreateDate(getCreateDate());
        exDto.setCreateDeptName(getCreateDeptName());
        return exDto;
    }
}
